﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AnesSystem.ViewModels;

namespace AnesSystem.Controls
{
    /// <summary>
    /// RealTimeSignShow.xaml 的交互逻辑
    /// </summary>
    public partial class RealTimeSignShowCtrl : UserControl
    {

        #region Variables

        private RealTimeSignShowCtrlViewModel _model;

        #endregion

        #region Constructor

        public RealTimeSignShowCtrl()
        {
            InitializeComponent();
            DrugAndEventWindow.Instance.PageDisplayed += Instance_PageDisplayed;
            this.Loaded += RealTimeSignShowCtrl_Loaded;
        }

        private void Instance_PageDisplayed(object sender, EventArgs e)
        {
            if(sender is RealTimeDialogCtrl)
            {
                if (_model != null)
                {
                    _model.SetCtrlFocus();
                }
            }
        }

        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        private void RealTimeSignShowCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            _model = this.DataContext as RealTimeSignShowCtrlViewModel;
        }

        #endregion


    }
}
